<?php
	namespace org\kahikai\database\mysql;
	
	use org\kahikai\domain\DevelopmentStep;

	use org\kahikai\database\fs\FsPictureDao;
	use org\kahikai\database\mysql\MysqlAliasDao;
	use org\kahikai\database\mysql\MysqlDevelopmentDao;
	use org\kahikai\database\mysql\MysqlGeneDao;
	use org\kahikai\database\mysql\MysqlGeneExpressionDao;
	use org\kahikai\database\mysql\MysqlLanguageDao;
	use org\kahikai\database\mysql\MysqlPaperDao;
	use org\kahikai\database\mysql\MysqlPhylogenyDao;
	use org\kahikai\database\mysql\MysqlSpeciesDao;
	
	require_once '../../../../../org/kahikai/database/fs/FsPictureDao.php';
	require_once '../../../../../org/kahikai/database/mysql/MysqlAliasDao.php';
	require_once '../../../../../org/kahikai/database/mysql/MysqlDevelopmentDao.php';
	require_once '../../../../../org/kahikai/database/mysql/MysqlGeneDao.php';
	require_once '../../../../../org/kahikai/database/mysql/MysqlGeneExpressionDao.php';
	require_once '../../../../../org/kahikai/database/mysql/MysqlLanguageDao.php';
	require_once '../../../../../org/kahikai/database/mysql/MysqlPaperDao.php';
	require_once '../../../../../org/kahikai/database/mysql/MysqlPhylogenyDao.php';
	require_once '../../../../../org/kahikai/database/mysql/MysqlSpeciesDao.php';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Cp1252"/>
<meta name="author" content="Ch4mp"/>
<link rel="shortcut icon" href="../../../../../favicon.ico" type="image/x-icon"/> 
<link rel="icon" href="../../../../../favicon.ico" type="image/x-icon"/>
<title>MysqlSpeciesDao test</title>
</head>
<body>
<?php
	session_start();
	
	if(!isset($_SESSION['languageDao'])) {
		$_SESSION['languageDao'] = new MysqlLanguageDao();
	}
	if(!isset($_SESSION['aliasDao'])) {
		$_SESSION['aliasDao'] = new MysqlAliasDao($_SESSION['languageDao']);
	}
	if(!isset($_SESSION['pictureDao'])) {
		$_SESSION['pictureDao'] = new FsPictureDao();
	}
	if(!isset($_SESSION['developmentDao'])) {
		$_SESSION['developmentDao'] = new MysqlDevelopmentDao($_SESSION['pictureDao']);
	}
	if(!isset($_SESSION['geneDao'])) {
		$_SESSION['geneDao'] = new MysqlGeneDao($_SESSION['aliasDao']);
	}
	if(!isset($_SESSION['geneExpressionDao'])) {
		$_SESSION['geneExpressionDao'] = new MysqlGeneExpressionDao();
	}
	if(!isset($_SESSION['paperDao'])) {
		$_SESSION['paperDao'] = new MysqlPaperDao();
	}
	if(!isset($_SESSION['phylogenyDao'])) {
		$_SESSION['phylogenyDao'] = new MysqlPhylogenyDao();
	}
	if(!isset($_SESSION['speciesDao'])) {
		$_SESSION['speciesDao'] = new MysqlSpeciesDao($_SESSION['aliasDao'], $_SESSION['paperDao'], $_SESSION['phylogenyDao'], $_SESSION['geneDao'], $_SESSION['developmentDao'], $_SESSION['geneExpressionDao']);
	}
	
// 	echo "<h1>getAll()</h1>\n";
// 	echo "<p>";
// 	foreach($_SESSION['speciesDao']->getAll() as $id => $name) {
// 		echo "$id: $name<br/>\n";
// 	}
// 	echo "</p>\n";
	
	echo "<h1>getById(1)</h1>\n";
	echo "<p>";
	foreach($_SESSION['speciesDao']->getById(1) as $pecies) {
		echo "$pecies->id: $pecies->name<br/>\n";
	}
	echo "</p>\n";
?>
</body>
</html>